<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看分类详情
     */
    function detailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/productInfo/getProductInfoObject.sjson",
            data: {productId:id},
            success: function(result){
                var data = eval("(" + result.data + ")");
                var productInfo = data.productInfo;
                var productImgList = data.productImgList;
                $("#d_smallPhoto").html("<img id='uploadImg_detail_"+id+"' class='uploadImg' onMouseOver='showDetailBigImage("+id+",3,3,0)'  onMouseOut='showDetailRebackImage("+id+",1,1)' src='${uploadPath}"+productInfo.smallPhoto+"' width='50px' height='50px' />");
                $("#d_qrCode").html("<img id='uploadImg_detail_"+id+"' class='uploadImg' onMouseOver='showDetailBigImage("+id+",3,3,0)'  onMouseOut='showDetailRebackImage("+id+",1,1)' src='${uploadPath}"+productInfo.qrCode+"' width='50px' height='50px' />");
                var imgHtml="";
                if(productImgList!=null&&productImgList!=""){
                    for(var i=0;i<productImgList.length;i++){
                        /*imgHtml+="<img id='uploadImg_detail_"+id+"' class='uploadImg' onMouseOver='showDetailBigImage("+id+",3,3,0)'  onMouseOut='showDetailRebackImage("+id+",1,1)' src='${uploadPath}"+data.uploadImage+"' width='50px' height='50px' />";*/
                        imgHtml+="<img src='${srcPath}"+productImgList[i].thumbnail+"' onerror='this.src=\"${uploadPath}productInfo/images/mrbj.png\"' width='50px' height='50px' style='margin-left:5px;'/>";
                    }
                }else{
                    imgHtml+="/";
                }
                $("#d_uploadImage").html(imgHtml);
                $("#d_productId").empty().html(productInfo.productId);
                $("#d_productName").empty().html(productInfo.productFullName);
                if(productInfo.productCode!=null&&productInfo.productCode!=""){
                    $("#d_productCode").html(productInfo.productCode);
                }else{
                    $("#d_productCode").html("/");
                }
                if(data.shopName!=null){
                    $("#d_shopName").html(data.shopName);
                }else{
                    $("#d_shopName").html("/");
                }
                $("#d_productTypeName").empty().html(data.productTypeName);//分类的名称
                if(data.shopProCategoryName!=null){
                    $("#d_shopProCategoryName").html(data.shopProCategoryName);
                }else{
                    $("#d_shopProCategoryName").html("/");
                }
                if(data.brandName!=null){
                    $("#d_brandId").html(data.brandName);
                }else{
                    $("#d_brandId").html("/");
                }
                $("#d_storeNumber").empty().html(productInfo.storeNumber);
                $("#d_marketPrice").empty().html(productInfo.marketPrice);
                $("#d_salesPrice").empty().html(productInfo.salesPrice);
                $("#d_giveAwayCoinNumber").empty().html(productInfo.giveAwayCoinNumber);
                if(productInfo.barCode!=null&&productInfo.barCode!=""){
                    $("#d_barCode").html(productInfo.barCode);
                }else{
                    $("#d_barCode").html("/");
                }
                if(productInfo.packingSpecifications!=null&&productInfo.packingSpecifications!=""){
                    $("#d_packingSpecifications").html(productInfo.packingSpecifications);
                }else{
                    $("#d_packingSpecifications").html("/");
                }
                $("#d_measuringUnitName").empty().html(productInfo.measuringUnitName);
                if(productInfo.manufacturerModel!=null&&productInfo.manufacturerModel!=""){
                    $("#d_manufacturerModel").html(productInfo.manufacturerModel);
                }else{
                    $("#d_manufacturerModel").html("/");
                }
                if(productInfo.isRecommend=="0"){
                    $("#d_isRecommend").html("<font class='color_002'>否</font>");
                }else{
                    $("#d_isRecommend").html("<font class='color_001'>是</font>");
                }
                if(productInfo.isPutSale=="1"){
                    $("#d_isPutSale").html("<font class='color_002'>未上架</font>");
                }else if(productInfo.isPutSale=="2"){
                    $("#d_isPutSale").html("<font class='color_001'>已上架</font>");
                }else{
                    $("#d_isPutSale").html("<font class='color_003'>违规下架</font>");
                }
                if(data.putSaleDate!=null&&data.putSaleDate!=""){
                    $("#d_putSaleDate").html(data.putSaleDate);
                }else{
                    $("#d_putSaleDate").html("/");
                }
                $("#d_createDate").empty().html(new Date(data.createDate).Format("yyyy-MM-dd hh:mm:ss"));
                if(data.updateDate!=null&&data.updateDate!=""){
                    $("#d_updateDate").html(new Date(data.updateDate).Format("yyyy-MM-dd hh:mm:ss"));
                }else{
                    $("#d_updateDate").html("/");
                }
                if(productInfo.isPass=="0"){
                    $("#d_isPass").html("<font class='color_002'>未通过</font>");
                }else if(productInfo.isPass=="1"){
                    $("#d_isPass").html("<font class='color_001'>已通过</font>");
                }else if(productInfo.isPass=="2"){
                    $("#d_isPass").html("<font class='color_004'>待申请</font>");
                }else if(productInfo.isPass=="3"){
                    $("#d_isPass").html("<font class='color_003'>待审核</font>");
                }
                if(productInfo.auditComment!=null&&productInfo.auditComment!=""){
                    $("#d_auditComment").html(productInfo.auditComment);
                }else{
                    $("#d_auditComment").html("/");
                }
                if(productInfo.note!=null&&productInfo.note!=""){
                    $("#d_note").html(productInfo.note);
                }else{
                    $("#d_note").html("/");
                }
                if(productInfo.seoTitle!=null&&productInfo.seoTitle!=""){
                    $("#d_seoTitle").html(productInfo.seoTitle);
                }else{
                    $("#d_seoTitle").html("/");
                }
                if(productInfo.seoKeyWord!=null&&productInfo.seoKeyWord!=""){
                    $("#d_seoKeyWord").html(productInfo.seoKeyWord);
                }else{
                    $("#d_seoKeyWord").html("/");
                }
                if(productInfo.seoDescription!=null&&productInfo.seoDescription!=""){
                    $("#d_seoDescription").html(productInfo.seoDescription);
                }else{
                    $("#d_seoDescription").html("/");
                }
            }
        });
    }
</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">商品信息详情</h5>
			</div>
			<div class="modal-body">
				<table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">商品LOGO:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_smallPhoto"></span></td>
						<td class="toright_td" width="150px">商品二维码:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_qrCode"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品ID:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_productId"></span></td>
						<td class="toright_td" width="150px">商品名称:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_productName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品编号:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_productCode"></span></td>
						<td class="toright_td" width="150px">店铺名称:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_shopName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品所属分类:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_productTypeName"></span></td>
						<td class="toright_td" width="150px">店铺内部分类:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_shopProCategoryName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品品牌:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_brandId"></span></td>
						<td class="toright_td" width="150px">库存数:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_storeNumber"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">市场价格:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_marketPrice"></span></td>
						<td class="toright_td" width="150px">销售价格:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_salesPrice"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商城赠送金币:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_giveAwayCoinNumber"></span></td>
						<td class="toright_td" width="150px">条形码:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_barCode"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">包装规格:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_packingSpecifications"></span></td>
						<td class="toright_td" width="150px">计量单位:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_measuringUnitName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">制造商型号:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_manufacturerModel"></span></td>
						<td class="toright_td" width="150px">是否推荐:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isRecommend"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">是否上架:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isPutSale"></span></td>
						<td class="toright_td" width="150px">上架时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_putSaleDate"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">创建时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_createDate"></span></td>
						<td class="toright_td" width="150px">更新时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_updateDate"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">审核状态:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isPass"></span></td>
						<td class="toright_td" width="150px">审核备注:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_auditComment"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品图片:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_uploadImage"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品备注:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_note"></span></td>
						<td class="toright_td" width="150px">SEO标题:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_seoTitle"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">SEO关键字:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_seoKeyWord"></span></td>
						<td class="toright_td" width="150px">SEO描述:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_seoDescription"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>